<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<!-- head 中 -->
	<link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
	<link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
	<link rel="stylesheet" href="${s.base}/mobile/css/weuix.min.css" />
	<link rel="stylesheet" href="${s.base}/mobile/css/index.css">
	<title>心动</title></head>

<body>
<div class="main">
	<div class=" bg-pink portrait_box" style="padding: 0.8rem;">
		<div class="weui-flex__item" style="overflow: hidden;">
			<img src="${member.headImage}" style="width: 3rem;height: 3rem;float: left;">
			<div class="portrait_box_name" style="display: inline-block;float: left;margin-left:1em;">
				<a href="javascript:goMyEdit('${memberId}');" class="overhidden" style="max-width:13rem;">${member.nickName}</a>
				<a class="icon icon-108 f-white" style="margin-top: 4px;"></a>
				<div style="display: block;">ID:
					<label>${member.cardNo}</label></div>
			</div>
		</div>
	</div>
	<div class="page__bd">
		<div class="weui-tab">
			<div class="weui-navbar">
				<div onclick="initMeLive()" class="weui-navbar__item tab-pink myLove">我心动的</div>
				<div onclick="initLiveMe()"  class="weui-navbar__item loveMy">心动我的</div></div>
			<div class="weui-tab__panel">
				<div id="tab1" class="weui-tab__content" style="display: block;">
					<div class="page-bd">
						<ul class="weui-mark" id="xyg-show">
						</ul>
					</div>
				</div>
				<div id="tab2" class="weui-tab__content">
				</div>
			</div>
		</div>
	</div>
</div>
<div class="weui-tabbar">
	<a href="javascript:goFistPage('${memberId}')" class="weui-tabbar__item">
		<div class="weui-tabbar__icon">
			<img src="${s.base}/mobile/img/start.png" alt=""></div>
		<div class="weui-tabbar__icon">
			<img src="${s.base}/mobile/img/start1.png" alt=""></div>
		<p class="weui-tabbar__label">发现</p></a>
	<a href="javascript:goMyPage('${memberId}')" class="weui-tabbar__item weui-bar__item--on">
		<div class="weui-tabbar__icon">
			<img src="${s.base}/mobile/img/my.png" alt=""></div>
		<div class="weui-tabbar__icon">
			<img src="${s.base}/mobile/img/my1.png" alt=""></div>
		<p class="weui-tabbar__label">我</p></a>
</div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
<script src="${s.base}/mobile/js/swiper.min.js"></script>
<script src="${s.base}/mobile/js/zepto.weui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/js/base.js?12132"></script>

<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<!--js分享代码结束-->
<script type="text/javascript">
    var memberId = '${memberId}';
    var pageStart=0;
    var num=10;
    var loading = false;  //状态标记
    $(document).ready(function(e) {
        initMeLive();
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            initMeLive();
        });
    });

    //喜欢我的
    function initLiveMe() {
        $("#tab1").hide();
        $(".weui-tab .weui-navbar__item").removeClass("tab-pink");
        $("#tab2").show();
        $(".loveMy").addClass("tab-pink");
        $.post("/phone/startedMe",{
            memberId:memberId
        },function(resultInfo){
            if(resultInfo.code=="1"){
                var html='<div style="text-align: center;">'+
                    '<div class="invite_tips">'+
                    '<img src="/mobile/img/lingdang2.png" width="40" height="40">'+
                    '<p>你还没开启“心动邀请”通知哦开启后，不再错过每一次心动</p>'+
                    '<a href="#" class="bg-pink">开启“心动邀请”通知</a></div>'+
                    '<div class="bg-pink" style="display: inline-block;padding: 0.4rem 0;color: #fff;font-size: 0.8rem;border-radius: 0.5rem;'+
                'font-weight: bold;margin:4rem auto 1rem;text-align: center;width: 84%;">创建交友卡片</div>'+
                '</div>';
                $("#tab2").html(html);
			}else{
                $("#tab2").html('<div class="page-bd"><ul class="weui-mark"></ul></div>');
                if (resultInfo.data!=null && resultInfo.data.length > 0){
                    for(var j=0;j<resultInfo.data.length;j++){
                        var obj = resultInfo.data[j];
                        var itemListHtml='<li onclick="goStartDesc(\''+memberId+'\',\''+obj.id+'\',\'1\')">'+
                            '<div class="weui-mark-img ">'+
                            '<img src="'+obj.myPic+'"></div>'+
                            '<span class="aixin">'+
                            '<img src="/mobile/img/aixin2.png">'+obj.myAttaNum+'</span>'+
                            '<div class="weui-mark-text">'+
                            '<p class="overhidden">'+obj.name;
                        if(obj.sex=="1"){
                            //男
                            itemListHtml+='<img src="/mobile/img/man.png">';
                        }else{
                            itemListHtml+='<img src="/mobile/img/women.png">';
                        }
                            itemListHtml+='<span class="overhidden">'+obj.createTime+'</span></div>'+
                            '</li>';
                        $("#tab2 .weui-mark").append(itemListHtml);
                    }
                }
			}
        },"json");
    }
    //我喜欢的
    function initMeLive() {
        $("#tab2").hide();
        $("#tab1").show();
        $(".weui-tab .weui-navbar__item").removeClass("tab-pink");
        $(".myLove").addClass("tab-pink");
        $("#xyg-show").html("");
        sendPost();
    }

    function sendPost() {
        $("#showContent").hide();
        pageStart++;
        $.post("/phone/myStarted",{
            limit : num,
            page : pageStart,
            memberId:memberId
        },function(resultInfo){
            if (resultInfo.data!=null && resultInfo.data.length > 0){
                for(var j=0;j<resultInfo.data.length;j++){
                    var obj = resultInfo.data[j];
                    var itemListHtml='<li onclick="goStartDesc(\''+memberId+'\',\''+obj.id+'\',\'2\')">'+
                        '<div class="weui-mark-img ">'+
                        '<img src="'+obj.otherPic+'"></div>'+
                        '<span class="aixin">'+
                        '<img src="/mobile/img/aixin2.png">'+obj.otherAttaNum+'</span>'+
                        '<div class="weui-mark-text">'+
                        '<p class="overhidden">'+obj.name;
                    if(obj.otherSex=="1"){
                        //男
						itemListHtml+='<img src="/mobile/img/man.png">';
					}else{
                        itemListHtml+='<img src="/mobile/img/women.png">';
					}
                    itemListHtml+='</p>'+
                        '<span class="overhidden">'+obj.createTime+'</span></div>'+
                        '</li>';
                    $("#xyg-show").append(itemListHtml);
                }
                loading = false;
                if(!resultInfo.hasNextPage){
                    $(document.body).destroyInfinite();
                    $(".xyg-product-list_loadmore").hide();
                }
            }else{
                $(document.body).destroyInfinite();
                $(".xyg-product-list_loadmore").hide();
            }

        },"json");
    }

</script>
</body>

</html>